
// LotroLCDView.cpp : implementation of the CLotroLCDView class
//

#include "stdafx.h"
// SHARED_HANDLERS can be defined in an ATL project implementing preview, thumbnail
// and search filter handlers and allows sharing of document code with that project.
#ifndef SHARED_HANDLERS
#include "LotroLCD.h"
#endif

#include "LotroLCDDoc.h"
#include "LotroLCDView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


// CLotroLCDView

IMPLEMENT_DYNCREATE(CLotroLCDView, CScrollView)

BEGIN_MESSAGE_MAP(CLotroLCDView, CScrollView)
END_MESSAGE_MAP()

// CLotroLCDView construction/destruction

CLotroLCDView::CLotroLCDView()
{
	TRACE("EnteringCLotroLCDView::CLotroLCDView\n");
}

CLotroLCDView::~CLotroLCDView()
{
}

BOOL CLotroLCDView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs
	TRACE("CLotroLCDView::PreCreateWindow\n");
	return CScrollView::PreCreateWindow(cs);
}

// CLotroLCDView drawing

void CLotroLCDView::OnDraw(CDC* pDC)
{
	CLotroLCDDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	if (!pDoc)
		return;

	CPoint pt(0, 0);
	CSize sz = GetDocument()->GetDocSize();
	CRect rect(pt, sz);
    //GetClientRect(&rect);
	pDC->DrawText(pDoc->readme, -1, rect, DT_LEFT | DT_TOP);
}

void CLotroLCDView::OnInitialUpdate()
{
	OnUpdate();
}

void CLotroLCDView::OnUpdate()
{
	// Get default document size from document and adjust
	SetScrollSizes( MM_TEXT, GetDocument()->GetDocSize());
	ResizeParentToFit();
	TRACE("CLotroLCDView::OnUpdate\n");
}

// CLotroLCDView diagnostics

#ifdef _DEBUG
void CLotroLCDView::AssertValid() const
{
	CScrollView::AssertValid();
}

void CLotroLCDView::Dump(CDumpContext& dc) const
{
	CScrollView::Dump(dc);
}

CLotroLCDDoc* CLotroLCDView::GetDocument() const // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CLotroLCDDoc)));
	return (CLotroLCDDoc*)m_pDocument;
}
#endif //_DEBUG


// CLotroLCDView message handlers
